﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;

namespace CsvHelper
{
    class Program
    {
        static void Main(string[] args)
        {
            //string file = @"P:\T0\CoMov\Data\ActiveSector\Position\5.28玖信分券.xls";
            //var dt = CsvHandler.CsvToDataTable(file, sep: '\t');

            //string file = $@"D:\yy_temp\BreakoutFactor\reg\TimeSeries\e9\TuneTrimSampleReg2\20180815\regress.result.csv";
            //DataTable dt = CsvHandler.CsvToDataTable(file, hasTitle: false);

            //List<DateTime> dtList = new List<DateTime>();
            //dtList.Add(new DateTime(1990, 1, 1));
            //CsvHandler.ListToCSV( "t.csv",dtList);

            List<DataSet> dtList = new List<DataSet>();
            var ds = new DataSet();
            ds.px.Add(11);
            dtList.Add(ds);
            CsvHandler.ListToCSV("t.csv", dtList);
        }

    }
    
    public class DataSet
    {
        public DateTime tm;
        public string ss;
        public Data dt;
        public List<float> px;
        public float[] ax;
        public DataSet()
        {
            dt = new Data();
            ss = "ok";
            px = new List<float>(5);
            ax = new float[5];
        }
    }

    public class Data
    {
        public float x;
        public float y;
        public Data()
        {
            x = 1f;
            y = 9f;
        }
    }
}
